-
Notifications
You must be signed in to change notification settings - Fork 88
feat(lightspeed): Add Escape key to cycle through display modes #2182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(lightspeed): Add Escape key to cycle through display modes #2182
Conversation
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
Changed Packages
|
HusneShabbir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've observed a deviation where using the keyboard's Escape key to exit the chat actions menu impacts the Lightspeed display mode. This issue occurs most of the time and is reproducible. Please find the attached recording for reference.
Screen.Recording.2026-01-27.at.11.53.54.PM.mov
HusneShabbir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aprilma419 what’s your take on the above observation?
|
@HusneShabbir looks good, didn't see any issues so far IMO |
karthikjeeyar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! I have a suggestion on finding the open modals, PTAL
| // Check if any modal dialog is currently visible (Delete, Rename, etc.) | ||
| const hasOpenModal = document.querySelector('.MuiDialog-root'); | ||
|
|
||
| // If settings dropdown or modal is open, let those handle Escape first | ||
| if (isSettingsDropdownOpen || hasOpenModal) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a brittle implementation and could break if MUI class names are changed or if we start using BUI instead of MUI.
const hasOpenModal = document.querySelector('.MuiDialog-root');
| isSettingsDropdownOpen: boolean; | ||
| /** | ||
| * Setter for settings dropdown open state | ||
| */ | ||
| setIsSettingsDropdownOpen: (isOpen: boolean) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is related to my previous comment.
Can you use similar approach to track if the rename/delete/attachment modals are open so that you can use that information to see if any modals are open, rather than relying on className .MuiDialog-root ?
pseudo code:
const [openModals, setOpenModals] = useState<Set<string>>(new Set());
const openModal = useCallback((modalId: string) => {
setOpenModals(prev => new Set(prev).add(modalId));
}, []);
const closeModal = useCallback((modalId: string) => {
setOpenModals(prev => {
const next = new Set(prev);
next.delete(modalId);
return next;
});
Then context can expose method and properties like openModal, closeModal, hasOpenModals etc, so that you can use this to decide whether to perform any action or not.



Description
UI after changes
Screen.Recording.2026-01-27.at.10.42.18.PM.mov
Fixes
✔️ Checklist